home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / programm.ing / falcon / nt_dsp1.lzh / NT_DSP1.MSA / FNTNS / SQRT1T.ASM < prev    next >
Encoding:
Assembly Source File  |  1989-01-24  |  1.1 KB  |  40 lines

  1. ;
  2. ; This program originally available on the Motorola DSP bulletin board.
  3. ; It is provided under a DISCLAMER OF WARRANTY available from
  4. ; Motorola DSP Operation, 6501 Wm. Cannon Drive W., Austin, Tx., 78735.
  5. ; Square Root by Polynomial Approximation, 7-bit Accuracy.
  6. ; (test program)
  7. ; Last Update 26 Jan 87   Version 1.0
  8. ;
  9. ;
  10. ;       square root test program
  11. ;
  12.         opt     cex
  13.         page    132,66,0,0
  14.         nolist
  15.         include 'dsplib:ioequ'
  16.         list
  17.         include 'dsplib:sqrt1'
  18.  
  19. datin   equ     $ffff           ;location in y memory of input file
  20. datout  equ     $fffe           ;location in y memory of output file
  21.  
  22.         org     y:0
  23. pcoef   dc      .5031642,-.2831102,.2726661
  24.  
  25.         org     p:$100
  26. start
  27.         movep   #0,x:M_BCR      ;no wait states on external io
  28. ;
  29.         do      #100,_e         ;number of points to do
  30.         move    #pcoef,r1       ;point to poly coef
  31.         movep   y:datin,x0      ;get input value
  32. ;
  33.         sqrt1
  34. ;
  35.         movep   a,y:datout      ;output square root
  36. _e                     
  37.         end
  38.